package com.weiyin.examination.course;

import android.app.Activity;
import android.content.Intent;
import android.widget.ViewFlipper;

import com.weiyin.examination.listener.CourseInterface;
import com.weiyin.examination.listener.DialogShowListener;
import com.weiyin.examination.module.TestModule;

import java.util.List;


/**
 * @author njf
 *         Created by lenovo on 2017/9/18.
 */

public abstract class Course {
    public static final String TAG = Course.class.getSimpleName();
    public CourseInterface courseInterface;
    public DialogShowListener dialogShowListener;

    /**
     * 将Course添加到ViewFlipper
     *
     * @param activity
     * @param viewFlipper
     * @param courseEntities
     * @param index
     */
    public abstract void onCreate(Activity activity, ViewFlipper viewFlipper, List<TestModule> courseEntities, int index);

    /**
     * 初始化控件
     */
    public abstract void initView();

    /**
     * 添加接口回调
     *
     * @param courseInterface
     */
    public abstract void setCourseInterface(CourseInterface courseInterface);

    /**
     * 添加是否弹出选择题目弹出
     *
     * @param dialogListener DialogShowListener
     */
    public abstract void setCourseDialogListener(DialogShowListener dialogListener);

    /**
     * ActivityResult
     *
     * @param requestCode
     * @param resultCode
     * @param data
     */
    public abstract void onActivityResult(int requestCode, int resultCode, Intent data);

    /**
     * 显示Course
     *
     * @param courseEntities
     * @param index
     * @param type
     */
    public abstract void show(List<TestModule> courseEntities, int index, String type);

    /**
     * 当Course显示在onStop时调用
     */
    public abstract void stop();

    /**
     * 当Course显示在onDestroy时调用
     */
    public abstract void destroy();
}